From 57b82795febc41bbdd2c637d80ec1d4436b5f529 Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 17 Oct 2006 15:36:08 +0000 Subject: [PATCH] Don't crash if we attempt -T input on a format that doesn't support it. --- gpsbabel/main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gpsbabel/main.c b/gpsbabel/main.c index 59ff76ff9..b2e36f8bf 100644 --- a/gpsbabel/main.c +++ b/gpsbabel/main.c @@ -440,7 +440,15 @@ main(int argc, char *argv[]) */ if (global_opts.masked_objective & POSNDATAMASK) { waypoint *wpt = waypt_new(); - ivecs->position_ops.rd_init(fname); + + if (!ivecs->position_ops.rd_position) { + fatal("Realtime tracking (-T) is not suppored by this input type.\n"); + } + + + if (ivecs->position_ops.rd_init) { + ivecs->position_ops.rd_init(fname); + } if (global_opts.masked_objective & ~POSNDATAMASK) { fatal("Realtime tracking (-T) is exclusive of other modes.\n"); -- 2.30.2